package com.gugee.ins.common.dal.mapper.statistics;

import com.gugee.common.mapper.GugeeMapper;
import com.gugee.ins.common.model.es.StatisticsData;
import com.gugee.ins.common.model.mysql.statistics.InsStBloggerGeneration;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface InsStBloggerGenerationMapper extends GugeeMapper<InsStBloggerGeneration> {

    @Delete("delete from ins_st_blogger_generation where uid = #{uid}")
    void deleteByUid(long uid);

    @Select("select * from ins_st_blogger_generation WHERE uid = #{uid} ORDER BY generation_rank ")
    List<InsStBloggerGeneration> findByUid(long uid);

    @Select("select generation `property`,generation_rank `rank`,generation_rate `value` from ins_st_blogger_generation WHERE uid = #{uid} ORDER BY generation_rank ")
    List<StatisticsData> findStatisticsDataByUid(long uid);
}